package cn.iocoder.yudao.module.api.member.alliance.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import jakarta.annotation.Nonnull;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 云盟商类型枚举
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/01/21
 */
@RequiredArgsConstructor
@Getter
public enum CloudAllianceTypeEnum implements EnumValuable {
    NORMAL(0, "普通用户"),
    MEMBER(1, "云盟用户"),
    MERCHANT(2, "云盟商户"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    @Nonnull
    public static CloudAllianceTypeEnum valueOf(Integer value) {
        for (CloudAllianceTypeEnum level : values()) {
            if (level.getValue().equals(value)) {
                return level;
            }
        }
        return NORMAL;
    }

}
